package com.dg11185.nearshop.net.request;

import com.dg11185.libs.network.http.client.HttpRequest;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.response.MyBehaviorResponse;

public class MyBehaviorRequest  extends HttpRequest<MyBehaviorResponse>{

	public MyBehaviorRequest (String userId , String type){
	
		   super(Constants.ADDRESS, Constants.myBehavior);
		   addParam("userId", userId);
		   addParam("type", type);
		   addParam("chshToken", Constants.TOKEN);
	}
	
	/**
	 * <必填可选参数>
	 * <param name="merchantId">商家编号（对应type为1）</param>
	 * </必填可选参数>
	 */
	
	public MyBehaviorRequest add(String key, String value){
        addParam(key, value);
        return this;
    }
	
	public MyBehaviorRequest encryption(){
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
        return this;
    }

	@Override
	protected MyBehaviorResponse parseJson(String response) throws Exception {
		// TODO Auto-generated method stub
		MyBehaviorResponse r = new MyBehaviorResponse();
        r.parseJson(response);
        return r;
	}
	
}
